Incoming Links

Hello Doors Community,

I want to paste all the Information stored in an Link (The Link path) to be displayed in a Attribute of Doors.

I had no luck with the Analysis --> Wizard, so I tried to write the Program myself as follows :

//////////////////////////////////////////////////////////////////////////////////////////

Object o
Link l
string ausgabe
 
for o in current do {
 
//All outgoing links
ausgabe = "" //init
for l in o ->"*" do {
if (ausgabe != ""){ 
 ausgabe = ausgabe "\n"
}  
//Collect characteristics
ausgabe = ausgabe fullName(target(l)) //Modulname von Target
ausgabe = ausgabe ":" targetAbsNo(l) ""
} 
o."Outgoing_Links" = ausgabe 
 
//Alle incoming links
    ausgabe = "" //init
for l in o <-"*" do {
if (ausgabe != ""){
 ausgabe = ausgabe "\n"
}  
ausgabe = ausgabe fullName(target(l)) //Modulname von Target
ausgabe = ausgabe ":" targetAbsNo(l) ""
}
o."Incoming_Links" = ausgabe 
}
////////////////////////////////////////////////////////////////////////////

For all the outgoing links it works fine, but for the incoming links, the program just posts the destination path (The row it is right now, and not the path it comes from)

Can someone explain my mistake to me?

I am thankful for any help 

Thanks Lerates

 

 


Lerates - Tue Jul 04 00:46:59 EDT 2017

Re: Incoming Links
HPM2BP - Mon Jul 17 03:36:40 EDT 2017

Hello!

 

First of all please use the Code formatting when posting a code (6th icon on the rich text editor, looks like this: <> )

This is only valid for the incoming links. The incoming links are tricky, because you don't see the source if the source is not opened, only if you use a special method, like this:

Object oCurrent = current

LinkRef lr = null       
ModName_ mSource = null

string strSourceModName = ""
string strLinkModName = ""


for lr in oCurrent <- "*" do {
        strLinkModName = fullName(module(lr)) ""
        mSource = source lr
        if (mSource != null){
                strSourceModName = fullName (mSource) ""
        }
        print "NEW LINK:\n"
        print "Link Module Name: " strLinkModName "\n"
        print "Source Module Name: " strSourceModName "\n-------------------------------\n"
}

Regards,

Peter